
#ifndef LEVEL_H
#define LEVEL_H

#include "CollectableManager.h"
#include "ImageManager.h"
#include "Utilities.h"
#include "Block.h"

#include "Diamond.h"

using namespace ETM::Resources;

namespace ETM
{
	class Player;

	class Level
	{
	private:
		float timer;
		std::vector<std::vector<Block>> values;
		sf::Sprite tileset;

		Player* player;
		CollectableManager CM;

	public:
		static const int tileSize = 32;

	public:
		Level();
		Level(std::string path);
		Level(unsigned int w, unsigned int h);
		void Update(float delta);
		void Render(sf::RenderWindow& window);

		void LoadBinary(const std::string& path);
		void LoadFromFile(const std::string& path);
		void Fill(CollisionType colType, int newVal);
		void Replace(int oldVal, int newVal);
		void Swap(int x1, int y1, int x2, int y2);
		void ClampView(sf::View& view);
		int GetWidth();
		int GetWidthInPixels();
		int GetHeight();
		int GetHeightInPixels();
		CollisionType GetCollisionType(int x, int y);
		sf::FloatRect GetBounds(int x, int y);
		void SetValue(int x, int y, int newVal);
		void SetCollisionType(int x, int y, CollisionType colType);
		void SetPlayer(Player* player);
	};
}

#endif